<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #img {
            width: 100px;
            height: auto;
        }
    </style>
</head>
<body>
    <div id="app">
        <button @click="prev" v-show="index>0">左</button>
        <img :src="imgSrc[index]" alt="" id="img" >
        <button @click="next" v-show="index<imgSrc.length-1">右</button>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        var app = new Vue({
            el:"#app",
            data:{
                imgSrc:["./img/1.JPG","./img/2.JPG","./img/3.JPG","./img/4.JPG","./img/5.JPG"],
                index: 0,
            },
            methods: {
                prev:function(){
                    this.index--;
                },
                next:function(){
                    this.index++;
                },
            },
        })
    </script>

</body>
</html>